<template>
  <w-cell
    :icon="model.pcStudyListPic"
    :title="model.title"
    :describe="model.dateStr"
    :detail="model.describe"
    :operation="true"
    @cellClick="cellClick"
    @editClick="editClick"
    @removeClick="removeClick"/>
</template>

<script>
import Config from '@/config/index'
import WCell from '@/components/pc/Cell/cell_01'
import StudyModel from '@/models/web/StudyModel'
export default {
  name: 'AdminWebConclusionCell',
  components: {
    WCell
  },
  props: {
    /**
     * 单个数据的模型
     */
    model: {
      type: StudyModel,
      default() {
        return new StudyModel()
      }
    }
  },
  methods: {
    /**
     * cell 点击
     */
    cellClick() {
      window.open(`#/web/conclusion/detail?id=${this.model._id}`)
    },
    /**
     * 编辑按钮点击
     */
    editClick() {
      this.$router.push({ name: 'AdminWebConclusionAdd', query: { id: this.model._id }})
    },
    /**
     * 删除按钮点击
     */
    removeClick() {
      this.model.dustbin_push('title').w_then(() => {
        this.$emit('reload')
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
